<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/ioport.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/ioport.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="k">/*</span>
<a name="2" /><span class="True">       2:</span> <span class="k"> * ioport.h    Definitions of routines for detecting, reserving and</span>
<a name="3" /><span class="True">       3:</span> <span class="k"> *        allocating system resources.</span>
<a name="4" /><span class="True">       4:</span> <span class="k"> *</span>
<a name="5" /><span class="True">       5:</span> <span class="k"> * Authors:    Linus Torvalds</span>
<a name="6" /><span class="True">       6:</span> <span class="k"> */</span>
<a name="7" /><span class="True">       7:</span> 
<a name="8" /><span class="True">       8:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX0lPUE9SVF9IXzA_"><span class="b">_LINUX_IOPORT_H</span></a>
<a name="9" /><span class="True">       9:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X0xJTlVYX0lPUE9SVF9IXzA_"><span class="b">_LINUX_IOPORT_H</span></a>
<a name="10" /><span class="True">      10:</span> 
<a name="11" /><span class="True">      11:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">__ASSEMBLY__</span>
<a name="12" /><span class="True">      12:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">compiler</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="13" /><span class="True">      13:</span> <span class="f">#</span><span class="n">include</span> <span class="f">&lt;</span><span class="b">linux</span><span class="f">/</span><span class="b">types</span><span class="f">.</span><span class="b">h</span><span class="f">&gt;</span>
<a name="14" /><span class="True">      14:</span> <span class="k">/*</span>
<a name="15" /><span class="True">      15:</span> <span class="k"> * Resources are tree-like, allowing</span>
<a name="16" /><span class="True">      16:</span> <span class="k"> * nesting etc..</span>
<a name="17" /><span class="True">      17:</span> <span class="k"> */</span>
<a name="18" /><span class="True">      18:</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">{</span>
<a name="19" /><span class="True">      19:</span>     <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">;</span>
<a name="20" /><span class="True">      20:</span>     <span class="b">resource_size_t</span> <span class="b">end</span><span class="f">;</span>
<a name="21" /><span class="True">      21:</span>     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">;</span>
<a name="22" /><span class="True">      22:</span>     <span class="m">unsigned</span> <span class="m">long</span> <span class="b">flags</span><span class="f">;</span>
<a name="23" /><span class="True">      23:</span>     <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span> <span class="f">*</span><span class="b">sibling</span><span class="f">,</span> <span class="f">*</span><span class="b">child</span><span class="f">;</span>
<a name="24" /><span class="True">      24:</span> <span class="f">}</span><span class="f">;</span>
<a name="25" /><span class="True">      25:</span> 
<a name="26" /><span class="True">      26:</span> <span class="k">/*</span>
<a name="27" /><span class="True">      27:</span> <span class="k"> * IO resources have these defined flags.</span>
<a name="28" /><span class="True">      28:</span> <span class="k"> */</span>
<a name="29" /><span class="True">      29:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9CSVRTXzA_"><span class="b">IORESOURCE_BITS</span></a>        <span class="c">0x000000ff</span>    <span class="k">/* Bus-specific bits */</span>
<a name="30" /><span class="True">      30:</span> 
<a name="31" /><span class="True">      31:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_SU9SRVNPVVJDRV9UWVBFX0JJVFNfMA__"><span class="b">IORESOURCE_TYPE_BITS</span></a>    <span class="c">0x00001f00</span>    <span class="k">/* Resource type */</span>
<a name="32" /><span class="True">      32:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JT18w"><span class="b">IORESOURCE_IO</span></a>        <span class="c">0x00000100</span>    <span class="k">/* PCI/ISA I/O ports */</span>
<a name="33" /><span class="True">      33:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fMA__"><span class="b">IORESOURCE_MEM</span></a>        <span class="c">0x00000200</span>
<a name="34" /><span class="True">      34:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9SRUdfMA__"><span class="b">IORESOURCE_REG</span></a>        <span class="c">0x00000300</span>    <span class="k">/* Register offsets */</span>
<a name="35" /><span class="True">      35:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfMA__"><span class="b">IORESOURCE_IRQ</span></a>        <span class="c">0x00000400</span>
<a name="36" /><span class="True">      36:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfMA__"><span class="b">IORESOURCE_DMA</span></a>        <span class="c">0x00000800</span>
<a name="37" /><span class="True">      37:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9CVVNfMA__"><span class="b">IORESOURCE_BUS</span></a>        <span class="c">0x00001000</span>
<a name="38" /><span class="True">      38:</span> 
<a name="39" /><span class="True">      39:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9QUkVGRVRDSF8w"><span class="b">IORESOURCE_PREFETCH</span></a>    <span class="c">0x00002000</span>    <span class="k">/* No side effects */</span>
<a name="40" /><span class="True">      40:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9SRUFET05MWV8w"><span class="b">IORESOURCE_READONLY</span></a>    <span class="c">0x00004000</span>
<a name="41" /><span class="True">      41:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9DQUNIRUFCTEVfMA__"><span class="b">IORESOURCE_CACHEABLE</span></a>    <span class="c">0x00008000</span>
<a name="42" /><span class="True">      42:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9SQU5HRUxFTkdUSF8w"><span class="b">IORESOURCE_RANGELENGTH</span></a>    <span class="c">0x00010000</span>
<a name="43" /><span class="True">      43:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9TSEFET1dBQkxFXzA_"><span class="b">IORESOURCE_SHADOWABLE</span></a>    <span class="c">0x00020000</span>
<a name="44" /><span class="True">      44:</span> 
<a name="45" /><span class="True">      45:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9TSVpFQUxJR05fMA__"><span class="b">IORESOURCE_SIZEALIGN</span></a>    <span class="c">0x00040000</span>    <span class="k">/* size indicates alignment */</span>
<a name="46" /><span class="True">      46:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9TVEFSVEFMSUdOXzA_"><span class="b">IORESOURCE_STARTALIGN</span></a>    <span class="c">0x00080000</span>    <span class="k">/* start field is alignment */</span>
<a name="47" /><span class="True">      47:</span> 
<a name="48" /><span class="True">      48:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fNjRfMA__"><span class="b">IORESOURCE_MEM_64</span></a>    <span class="c">0x00100000</span>
<a name="49" /><span class="True">      49:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9XSU5ET1dfMA__"><span class="b">IORESOURCE_WINDOW</span></a>    <span class="c">0x00200000</span>    <span class="k">/* forwarded by bridge */</span>
<a name="50" /><span class="True">      50:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NVVhFRF8w"><span class="b">IORESOURCE_MUXED</span></a>    <span class="c">0x00400000</span>    <span class="k">/* Resource is software muxed */</span>
<a name="51" /><span class="True">      51:</span> 
<a name="52" /><span class="True">      52:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9FWENMVVNJVkVfMA__"><span class="b">IORESOURCE_EXCLUSIVE</span></a>    <span class="c">0x08000000</span>    <span class="k">/* Userland may not map this resource */</span>
<a name="53" /><span class="True">      53:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ESVNBQkxFRF8w"><span class="b">IORESOURCE_DISABLED</span></a>    <span class="c">0x10000000</span>
<a name="54" /><span class="True">      54:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9VTlNFVF8w"><span class="b">IORESOURCE_UNSET</span></a>    <span class="c">0x20000000</span>
<a name="55" /><span class="True">      55:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9BVVRPXzA_"><span class="b">IORESOURCE_AUTO</span></a>        <span class="c">0x40000000</span>
<a name="56" /><span class="True">      56:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9CVVNZXzA_"><span class="b">IORESOURCE_BUSY</span></a>        <span class="c">0x80000000</span>    <span class="k">/* Driver has marked this resource busy */</span>
<a name="57" /><span class="True">      57:</span> 
<a name="58" /><span class="True">      58:</span> <span class="k">/* PnP IRQ specific bits (IORESOURCE_BITS) */</span>
<a name="59" /><span class="True">      59:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfSElHSEVER0VfMA__"><span class="b">IORESOURCE_IRQ_HIGHEDGE</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="60" /><span class="True">      60:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfTE9XRURHRV8w"><span class="b">IORESOURCE_IRQ_LOWEDGE</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">1</span><span class="f">)</span>
<a name="61" /><span class="True">      61:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfSElHSExFVkVMXzA_"><span class="b">IORESOURCE_IRQ_HIGHLEVEL</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">2</span><span class="f">)</span>
<a name="62" /><span class="True">      62:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfTE9XTEVWRUxfMA__"><span class="b">IORESOURCE_IRQ_LOWLEVEL</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="63" /><span class="True">      63:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfU0hBUkVBQkxFXzA_"><span class="b">IORESOURCE_IRQ_SHAREABLE</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">4</span><span class="f">)</span>
<a name="64" /><span class="True">      64:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfT1BUSU9OQUxfMA__"><span class="b">IORESOURCE_IRQ_OPTIONAL</span></a>     <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">5</span><span class="f">)</span>
<a name="65" /><span class="True">      65:</span> 
<a name="66" /><span class="True">      66:</span> <span class="k">/* PnP DMA specific bits (IORESOURCE_BITS) */</span>
<a name="67" /><span class="True">      67:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfVFlQRV9NQVNLXzA_"><span class="b">IORESOURCE_DMA_TYPE_MASK</span></a>    <span class="f">(</span><span class="c">3</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="68" /><span class="True">      68:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfOEJJVF8w"><span class="b">IORESOURCE_DMA_8BIT</span></a>        <span class="f">(</span><span class="c">0</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="69" /><span class="True">      69:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfOEFORDE2QklUXzA_"><span class="b">IORESOURCE_DMA_8AND16BIT</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="70" /><span class="True">      70:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfMTZCSVRfMA__"><span class="b">IORESOURCE_DMA_16BIT</span></a>        <span class="f">(</span><span class="c">2</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="71" /><span class="True">      71:</span> 
<a name="72" /><span class="True">      72:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfTUFTVEVSXzA_"><span class="b">IORESOURCE_DMA_MASTER</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">2</span><span class="f">)</span>
<a name="73" /><span class="True">      73:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfQllURV8w"><span class="b">IORESOURCE_DMA_BYTE</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="74" /><span class="True">      74:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfV09SRF8w"><span class="b">IORESOURCE_DMA_WORD</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">4</span><span class="f">)</span>
<a name="75" /><span class="True">      75:</span> 
<a name="76" /><span class="True">      76:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfU1BFRURfTUFTS18w"><span class="b">IORESOURCE_DMA_SPEED_MASK</span></a>    <span class="f">(</span><span class="c">3</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="77" /><span class="True">      77:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfQ09NUEFUSUJMRV8w"><span class="b">IORESOURCE_DMA_COMPATIBLE</span></a>    <span class="f">(</span><span class="c">0</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="78" /><span class="True">      78:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfVFlQRUFfMA__"><span class="b">IORESOURCE_DMA_TYPEA</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="79" /><span class="True">      79:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfVFlQRUJfMA__"><span class="b">IORESOURCE_DMA_TYPEB</span></a>        <span class="f">(</span><span class="c">2</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="80" /><span class="True">      80:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfVFlQRUZfMA__"><span class="b">IORESOURCE_DMA_TYPEF</span></a>        <span class="f">(</span><span class="c">3</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="81" /><span class="True">      81:</span> 
<a name="82" /><span class="True">      82:</span> <span class="k">/* PnP memory I/O specific bits (IORESOURCE_BITS) */</span>
<a name="83" /><span class="True">      83:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fV1JJVEVBQkxFXzA_"><span class="b">IORESOURCE_MEM_WRITEABLE</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>    <span class="k">/* dup: IORESOURCE_READONLY */</span>
<a name="84" /><span class="True">      84:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fQ0FDSEVBQkxFXzA_"><span class="b">IORESOURCE_MEM_CACHEABLE</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">1</span><span class="f">)</span>    <span class="k">/* dup: IORESOURCE_CACHEABLE */</span>
<a name="85" /><span class="True">      85:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fUkFOR0VMRU5HVEhfMA__"><span class="b">IORESOURCE_MEM_RANGELENGTH</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">2</span><span class="f">)</span>    <span class="k">/* dup: IORESOURCE_RANGELENGTH */</span>
<a name="86" /><span class="True">      86:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fVFlQRV9NQVNLXzA_"><span class="b">IORESOURCE_MEM_TYPE_MASK</span></a>    <span class="f">(</span><span class="c">3</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="87" /><span class="True">      87:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fOEJJVF8w"><span class="b">IORESOURCE_MEM_8BIT</span></a>        <span class="f">(</span><span class="c">0</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="88" /><span class="True">      88:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fMTZCSVRfMA__"><span class="b">IORESOURCE_MEM_16BIT</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="89" /><span class="True">      89:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fOEFORDE2QklUXzA_"><span class="b">IORESOURCE_MEM_8AND16BIT</span></a>    <span class="f">(</span><span class="c">2</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="90" /><span class="True">      90:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fMzJCSVRfMA__"><span class="b">IORESOURCE_MEM_32BIT</span></a>        <span class="f">(</span><span class="c">3</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>
<a name="91" /><span class="True">      91:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fU0hBRE9XQUJMRV8w"><span class="b">IORESOURCE_MEM_SHADOWABLE</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">5</span><span class="f">)</span>    <span class="k">/* dup: IORESOURCE_SHADOWABLE */</span>
<a name="92" /><span class="True">      92:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fRVhQQU5TSU9OUk9NXzA_"><span class="b">IORESOURCE_MEM_EXPANSIONROM</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">6</span><span class="f">)</span>
<a name="93" /><span class="True">      93:</span> 
<a name="94" /><span class="True">      94:</span> <span class="k">/* PnP I/O specific bits (IORESOURCE_BITS) */</span>
<a name="95" /><span class="True">      95:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JT18xNkJJVF9BRERSXzA_"><span class="b">IORESOURCE_IO_16BIT_ADDR</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>
<a name="96" /><span class="True">      96:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JT19GSVhFRF8w"><span class="b">IORESOURCE_IO_FIXED</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">1</span><span class="f">)</span>
<a name="97" /><span class="True">      97:</span> 
<a name="98" /><span class="True">      98:</span> <span class="k">/* PCI ROM control bits (IORESOURCE_BITS) */</span>
<a name="99" /><span class="True">      99:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ST01fRU5BQkxFXzA_"><span class="b">IORESOURCE_ROM_ENABLE</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">0</span><span class="f">)</span>    <span class="k">/* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */</span>
<a name="100" /><span class="True">     100:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ST01fU0hBRE9XXzA_"><span class="b">IORESOURCE_ROM_SHADOW</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">1</span><span class="f">)</span>    <span class="k">/* ROM is copy at C000:0 */</span>
<a name="101" /><span class="True">     101:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ST01fQ09QWV8w"><span class="b">IORESOURCE_ROM_COPY</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">2</span><span class="f">)</span>    <span class="k">/* ROM is alloc&apos;d copy, resource field overlaid */</span>
<a name="102" /><span class="True">     102:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ST01fQklPU19DT1BZXzA_"><span class="b">IORESOURCE_ROM_BIOS_COPY</span></a>    <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">3</span><span class="f">)</span>    <span class="k">/* ROM is BIOS copy, resource field overlaid */</span>
<a name="103" /><span class="True">     103:</span> 
<a name="104" /><span class="True">     104:</span> <span class="k">/* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */</span>
<a name="105" /><span class="True">     105:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9QQ0lfRklYRURfMA__"><span class="b">IORESOURCE_PCI_FIXED</span></a>        <span class="f">(</span><span class="c">1</span><span class="f">&lt;&lt;</span><span class="c">4</span><span class="f">)</span>    <span class="k">/* Do not move resource */</span>
<a name="106" /><span class="True">     106:</span> 
<a name="107" /><span class="True">     107:</span> 
<a name="108" /><span class="True">     108:</span> <span class="k">/* helpers to define resources */</span>
<a name="109" /><span class="True">     109:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19OQU1FRF8w"><span class="b">DEFINE_RES_NAMED</span></a><span class="f">(</span><span class="b">_start</span><span class="f">,</span> <span class="b">_size</span><span class="f">,</span> <span class="b">_name</span><span class="f">,</span> <span class="b">_flags</span><span class="f">)</span>            \
<a name="110" /><span class="True">     110:</span>     <span class="f">{</span>                                \
<a name="111" /><span class="True">     111:</span>         <span class="f">.</span><span class="b">start</span> <span class="f">=</span> <span class="f">(</span><span class="b">_start</span><span class="f">)</span><span class="f">,</span>                    \
<a name="112" /><span class="True">     112:</span>         <span class="f">.</span><span class="b">end</span> <span class="f">=</span> <span class="f">(</span><span class="b">_start</span><span class="f">)</span> <span class="f">+</span> <span class="f">(</span><span class="b">_size</span><span class="f">)</span> <span class="f">-</span> <span class="c">1</span><span class="f">,</span>                \
<a name="113" /><span class="True">     113:</span>         <span class="f">.</span><span class="b">name</span> <span class="f">=</span> <span class="f">(</span><span class="b">_name</span><span class="f">)</span><span class="f">,</span>                    \
<a name="114" /><span class="True">     114:</span>         <span class="f">.</span><span class="b">flags</span> <span class="f">=</span> <span class="f">(</span><span class="b">_flags</span><span class="f">)</span><span class="f">,</span>                    \
<a name="115" /><span class="True">     115:</span>     <span class="f">}</span>
<a name="116" /><span class="True">     116:</span> 
<a name="117" /><span class="True">     117:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JT19OQU1FRF8w"><span class="b">DEFINE_RES_IO_NAMED</span></a><span class="f">(</span><span class="b">_start</span><span class="f">,</span> <span class="b">_size</span><span class="f">,</span> <span class="b">_name</span><span class="f">)</span>            \
<a name="118" /><span class="True">     118:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19OQU1FRF8w"><span class="b">DEFINE_RES_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_size</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JT18w"><span class="b">IORESOURCE_IO</span></a><span class="f">)</span>
<a name="119" /><span class="True">     119:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JT18w"><span class="b">DEFINE_RES_IO</span></a><span class="f">(</span><span class="b">_start</span><span class="f">,</span> <span class="b">_size</span><span class="f">)</span>                    \
<a name="120" /><span class="True">     120:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JT19OQU1FRF8w"><span class="b">DEFINE_RES_IO_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_size</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="121" /><span class="True">     121:</span> 
<a name="122" /><span class="True">     122:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19NRU1fTkFNRURfMA__"><span class="b">DEFINE_RES_MEM_NAMED</span></a><span class="f">(</span><span class="b">_start</span><span class="f">,</span> <span class="b">_size</span><span class="f">,</span> <span class="b">_name</span><span class="f">)</span>            \
<a name="123" /><span class="True">     123:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19OQU1FRF8w"><span class="b">DEFINE_RES_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_size</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NRU1fMA__"><span class="b">IORESOURCE_MEM</span></a><span class="f">)</span>
<a name="124" /><span class="True">     124:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19NRU1fMA__"><span class="b">DEFINE_RES_MEM</span></a><span class="f">(</span><span class="b">_start</span><span class="f">,</span> <span class="b">_size</span><span class="f">)</span>                    \
<a name="125" /><span class="True">     125:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19NRU1fTkFNRURfMA__"><span class="b">DEFINE_RES_MEM_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">_size</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="126" /><span class="True">     126:</span> 
<a name="127" /><span class="True">     127:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JUlFfTkFNRURfMA__"><span class="b">DEFINE_RES_IRQ_NAMED</span></a><span class="f">(</span><span class="b">_irq</span><span class="f">,</span> <span class="b">_name</span><span class="f">)</span>                \
<a name="128" /><span class="True">     128:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19OQU1FRF8w"><span class="b">DEFINE_RES_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_irq</span><span class="f">)</span><span class="f">,</span> <span class="c">1</span><span class="f">,</span> <span class="f">(</span><span class="b">_name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9JUlFfMA__"><span class="b">IORESOURCE_IRQ</span></a><span class="f">)</span>
<a name="129" /><span class="True">     129:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JUlFfMA__"><span class="b">DEFINE_RES_IRQ</span></a><span class="f">(</span><span class="b">_irq</span><span class="f">)</span>                        \
<a name="130" /><span class="True">     130:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19JUlFfTkFNRURfMA__"><span class="b">DEFINE_RES_IRQ_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_irq</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="131" /><span class="True">     131:</span> 
<a name="132" /><span class="True">     132:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19ETUFfTkFNRURfMA__"><span class="b">DEFINE_RES_DMA_NAMED</span></a><span class="f">(</span><span class="b">_dma</span><span class="f">,</span> <span class="b">_name</span><span class="f">)</span>                \
<a name="133" /><span class="True">     133:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19OQU1FRF8w"><span class="b">DEFINE_RES_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_dma</span><span class="f">)</span><span class="f">,</span> <span class="c">1</span><span class="f">,</span> <span class="f">(</span><span class="b">_name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9ETUFfMA__"><span class="b">IORESOURCE_DMA</span></a><span class="f">)</span>
<a name="134" /><span class="True">     134:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19ETUFfMA__"><span class="b">DEFINE_RES_DMA</span></a><span class="f">(</span><span class="b">_dma</span><span class="f">)</span>                        \
<a name="135" /><span class="True">     135:</span>     <a href="cpu.c_macros_noref.html#_REVGSU5FX1JFU19ETUFfTkFNRURfMA__"><span class="b">DEFINE_RES_DMA_NAMED</span></a><span class="f">(</span><span class="f">(</span><span class="b">_dma</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="136" /><span class="True">     136:</span> 
<a name="137" /><span class="True">     137:</span> <span class="k">/* PC/ISA/whatever - the normal PC address spaces: IO and memory */</span>
<a name="138" /><span class="True">     138:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="b">ioport_resource</span><span class="f">;</span>
<a name="139" /><span class="True">     139:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="b">iomem_resource</span><span class="f">;</span>
<a name="140" /><span class="True">     140:</span> 
<a name="141" /><span class="True">     141:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">request_resource_conflict</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="142" /><span class="True">     142:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">request_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="143" /><span class="True">     143:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">release_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="144" /><span class="True">     144:</span> <span class="m">void</span> <span class="b">release_child_resources</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="145" /><span class="True">     145:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">reserve_region_with_split</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span>
<a name="146" /><span class="True">     146:</span>                  <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">end</span><span class="f">,</span>
<a name="147" /><span class="True">     147:</span>                  <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">)</span><span class="f">;</span>
<a name="148" /><span class="True">     148:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">insert_resource_conflict</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="149" /><span class="True">     149:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">insert_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="150" /><span class="True">     150:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">insert_resource_expand_to_fit</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">)</span><span class="f">;</span>
<a name="151" /><span class="True">     151:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">arch_remove_reservations</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">avail</span><span class="f">)</span><span class="f">;</span>
<a name="152" /><span class="True">     152:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">allocate_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="m">new</span><span class="f">,</span>
<a name="153" /><span class="True">     153:</span>                  <span class="b">resource_size_t</span> <span class="b">size</span><span class="f">,</span> <span class="b">resource_size_t</span> <a href="cpu.c_macros_noref.html#_bWluXzA_"><span class="b">min</span></a><span class="f">,</span>
<a name="154" /><span class="True">     154:</span>                  <span class="b">resource_size_t</span> <a href="cpu.c_macros_ref.html#_bWF4XzA_"><span class="b">max</span></a><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">align</span><span class="f">,</span>
<a name="155" /><span class="True">     155:</span>                  <span class="b">resource_size_t</span> <span class="f">(</span><span class="f">*</span><span class="b">alignf</span><span class="f">)</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">,</span>
<a name="156" /><span class="True">     156:</span>                                <span class="m">const</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="f">,</span>
<a name="157" /><span class="True">     157:</span>                                <span class="b">resource_size_t</span><span class="f">,</span>
<a name="158" /><span class="True">     158:</span>                                <span class="b">resource_size_t</span><span class="f">)</span><span class="f">,</span>
<a name="159" /><span class="True">     159:</span>                  <span class="m">void</span> <span class="f">*</span><span class="b">alignf_data</span><span class="f">)</span><span class="f">;</span>
<a name="160" /><span class="True">     160:</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">lookup_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">root</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">)</span><span class="f">;</span>
<a name="161" /><span class="True">     161:</span> <span class="m">int</span> <span class="b">adjust_resource</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">,</span>
<a name="162" /><span class="True">     162:</span>             <span class="b">resource_size_t</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="163" /><span class="True">     163:</span> <span class="b">resource_size_t</span> <span class="b">resource_alignment</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span><span class="f">;</span>
<a name="164" /><span class="True">     164:</span> <span class="m">static</span> <span class="m">inline</span> <span class="b">resource_size_t</span> <span class="b">resource_size</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span>
<a name="165" /><span class="True">     165:</span> <span class="f">{</span>
<a name="166" /><span class="True">     166:</span>     <span class="m">return</span> <span class="b">res</span><span class="f">-&gt;</span><span class="b">end</span> <span class="f">-</span> <span class="b">res</span><span class="f">-&gt;</span><span class="b">start</span> <span class="f">+</span> <span class="c">1</span><span class="f">;</span>
<a name="167" /><span class="True">     167:</span> <span class="f">}</span>
<a name="168" /><span class="True">     168:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">resource_type</span><span class="f">(</span><span class="m">const</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">res</span><span class="f">)</span>
<a name="169" /><span class="True">     169:</span> <span class="f">{</span>
<a name="170" /><span class="True">     170:</span>     <span class="m">return</span> <span class="b">res</span><span class="f">-&gt;</span><span class="b">flags</span> <span class="f">&amp;</span> <a href="cpu.c_macros_ref.html#_SU9SRVNPVVJDRV9UWVBFX0JJVFNfMA__"><span class="b">IORESOURCE_TYPE_BITS</span></a><span class="f">;</span>
<a name="171" /><span class="True">     171:</span> <span class="f">}</span>
<a name="172" /><span class="True">     172:</span> 
<a name="173" /><span class="True">     173:</span> <span class="k">/* Convenience shorthand with allocation */</span>
<a name="174" /><span class="True">     174:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVxdWVzdF9yZWdpb25fMA__"><span class="b">request_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span>        <span class="b">__request_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="175" /><span class="True">     175:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVxdWVzdF9tdXhlZF9yZWdpb25fMA__"><span class="b">request_muxed_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span>    <span class="b">__request_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9NVVhFRF8w"><span class="b">IORESOURCE_MUXED</span></a><span class="f">)</span>
<a name="176" /><span class="True">     176:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_X19yZXF1ZXN0X21lbV9yZWdpb25fMA__"><span class="b">__request_mem_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">,</span> <span class="b">excl</span><span class="f">)</span> <span class="b">__request_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">,</span> <span class="b">excl</span><span class="f">)</span>
<a name="177" /><span class="True">     177:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVxdWVzdF9tZW1fcmVnaW9uXzA_"><span class="b">request_mem_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span> <span class="b">__request_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">,</span> <span class="c">0</span><span class="f">)</span>
<a name="178" /><span class="True">     178:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVxdWVzdF9tZW1fcmVnaW9uX2V4Y2x1c2l2ZV8w"><span class="b">request_mem_region_exclusive</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span> \
<a name="179" /><span class="True">     179:</span>     <span class="b">__request_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">,</span> <a href="cpu.c_macros_noref.html#_SU9SRVNPVVJDRV9FWENMVVNJVkVfMA__"><span class="b">IORESOURCE_EXCLUSIVE</span></a><span class="f">)</span>
<a name="180" /><span class="True">     180:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVuYW1lX3JlZ2lvbl8w"><span class="b">rename_region</span></a><span class="f">(</span><span class="b">region</span><span class="f">,</span> <span class="b">newname</span><span class="f">)</span> <span class="m">do</span> <span class="f">{</span> <span class="f">(</span><span class="b">region</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">name</span> <span class="f">=</span> <span class="f">(</span><span class="b">newname</span><span class="f">)</span><span class="f">;</span> <span class="f">}</span> <span class="m">while</span> <span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="181" /><span class="True">     181:</span> 
<a name="182" /><span class="True">     182:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span> <span class="b">__request_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="f">,</span>
<a name="183" /><span class="True">     183:</span>                     <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">,</span>
<a name="184" /><span class="True">     184:</span>                     <span class="b">resource_size_t</span> <span class="b">n</span><span class="f">,</span>
<a name="185" /><span class="True">     185:</span>                     <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">,</span> <span class="m">int</span> <span class="b">flags</span><span class="f">)</span><span class="f">;</span>
<a name="186" /><span class="True">     186:</span> 
<a name="187" /><span class="True">     187:</span> <span class="k">/* Compatibility cruft */</span>
<a name="188" /><span class="True">     188:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVsZWFzZV9yZWdpb25fMA__"><span class="b">release_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">)</span>    <span class="b">__release_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="189" /><span class="True">     189:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_Y2hlY2tfbWVtX3JlZ2lvbl8w"><span class="b">check_mem_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">)</span>    <span class="b">__check_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="190" /><span class="True">     190:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_cmVsZWFzZV9tZW1fcmVnaW9uXzA_"><span class="b">release_mem_region</span></a><span class="f">(</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">)</span>    <span class="b">__release_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="191" /><span class="True">     191:</span> 
<a name="192" /><span class="True">     192:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">__check_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="f">,</span> <span class="b">resource_size_t</span><span class="f">,</span> <span class="b">resource_size_t</span><span class="f">)</span><span class="f">;</span>
<a name="193" /><span class="True">     193:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">__release_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="f">,</span> <span class="b">resource_size_t</span><span class="f">,</span>
<a name="194" /><span class="True">     194:</span>                 <span class="b">resource_size_t</span><span class="f">)</span><span class="f">;</span>
<a name="195" /><span class="False">     195:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">CONFIG_MEMORY_HOTREMOVE</span>
<a name="196" /><span class="False">     196:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">release_mem_region_adjustable</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="f">,</span> <span class="b">resource_size_t</span><span class="f">,</span>
<a name="197" /><span class="False">     197:</span>                 <span class="b">resource_size_t</span><span class="f">)</span><span class="f">;</span>
<a name="198" /><span class="True">     198:</span> <span class="f">#</span><span class="n">endif</span>
<a name="199" /><span class="True">     199:</span> 
<a name="200" /><span class="True">     200:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">int</span> <a href="cpu.c_macros_ref.html#_X19kZXByZWNhdGVkXzE_"><span class="b">__deprecated</span></a> <span class="b">check_region</span><span class="f">(</span><span class="b">resource_size_t</span> <span class="b">s</span><span class="f">,</span>
<a name="201" /><span class="True">     201:</span>                         <span class="b">resource_size_t</span> <span class="b">n</span><span class="f">)</span>
<a name="202" /><span class="True">     202:</span> <span class="f">{</span>
<a name="203" /><span class="True">     203:</span>     <span class="m">return</span> <span class="b">__check_region</span><span class="f">(</span><span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="b">s</span><span class="f">,</span> <span class="b">n</span><span class="f">)</span><span class="f">;</span>
<a name="204" /><span class="True">     204:</span> <span class="f">}</span>
<a name="205" /><span class="True">     205:</span> 
<a name="206" /><span class="True">     206:</span> <span class="k">/* Wrappers for managed devices */</span>
<a name="207" /><span class="True">     207:</span> <span class="m">struct</span> <span class="b">device</span><span class="f">;</span>
<a name="208" /><span class="True">     208:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2bV9yZXF1ZXN0X3JlZ2lvbl8w"><span class="b">devm_request_region</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span> \
<a name="209" /><span class="True">     209:</span>     <span class="b">__devm_request_region</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">)</span>
<a name="210" /><span class="True">     210:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2bV9yZXF1ZXN0X21lbV9yZWdpb25fMA__"><span class="b">devm_request_mem_region</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span><span class="b">start</span><span class="f">,</span><span class="b">n</span><span class="f">,</span><span class="b">name</span><span class="f">)</span> \
<a name="211" /><span class="True">     211:</span>     <span class="b">__devm_request_region</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">name</span><span class="f">)</span><span class="f">)</span>
<a name="212" /><span class="True">     212:</span> 
<a name="213" /><span class="True">     213:</span> <span class="m">extern</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span> <span class="b">__devm_request_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span>
<a name="214" /><span class="True">     214:</span>                 <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">,</span>
<a name="215" /><span class="True">     215:</span>                 <span class="b">resource_size_t</span> <span class="b">n</span><span class="f">,</span> <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">name</span><span class="f">)</span><span class="f">;</span>
<a name="216" /><span class="True">     216:</span> 
<a name="217" /><span class="True">     217:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2bV9yZWxlYXNlX3JlZ2lvbl8w"><span class="b">devm_release_region</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">n</span><span class="f">)</span> \
<a name="218" /><span class="True">     218:</span>     <span class="b">__devm_release_region</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">ioport_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="219" /><span class="True">     219:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_ZGV2bV9yZWxlYXNlX21lbV9yZWdpb25fMA__"><span class="b">devm_release_mem_region</span></a><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="b">start</span><span class="f">,</span> <span class="b">n</span><span class="f">)</span> \
<a name="220" /><span class="True">     220:</span>     <span class="b">__devm_release_region</span><span class="f">(</span><span class="b">dev</span><span class="f">,</span> <span class="f">&amp;</span><span class="b">iomem_resource</span><span class="f">,</span> <span class="f">(</span><span class="b">start</span><span class="f">)</span><span class="f">,</span> <span class="f">(</span><span class="b">n</span><span class="f">)</span><span class="f">)</span>
<a name="221" /><span class="True">     221:</span> 
<a name="222" /><span class="True">     222:</span> <span class="m">extern</span> <span class="m">void</span> <span class="b">__devm_release_region</span><span class="f">(</span><span class="m">struct</span> <span class="b">device</span> <span class="f">*</span><span class="b">dev</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">parent</span><span class="f">,</span>
<a name="223" /><span class="True">     223:</span>                   <span class="b">resource_size_t</span> <span class="b">start</span><span class="f">,</span> <span class="b">resource_size_t</span> <span class="b">n</span><span class="f">)</span><span class="f">;</span>
<a name="224" /><span class="True">     224:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">iomem_map_sanity_check</span><span class="f">(</span><span class="b">resource_size_t</span> <span class="b">addr</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">size</span><span class="f">)</span><span class="f">;</span>
<a name="225" /><span class="True">     225:</span> <span class="m">extern</span> <span class="m">int</span> <span class="b">iomem_is_exclusive</span><span class="f">(</span><span class="b">u64</span> <span class="b">addr</span><span class="f">)</span><span class="f">;</span>
<a name="226" /><span class="True">     226:</span> 
<a name="227" /><span class="True">     227:</span> <span class="m">extern</span> <span class="m">int</span>
<a name="228" /><span class="True">     228:</span> <span class="b">walk_system_ram_range</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">start_pfn</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span> <span class="b">nr_pages</span><span class="f">,</span>
<a name="229" /><span class="True">     229:</span>         <span class="m">void</span> <span class="f">*</span><span class="b">arg</span><span class="f">,</span> <span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">func</span><span class="f">)</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">unsigned</span> <span class="m">long</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">)</span><span class="f">;</span>
<a name="230" /><span class="True">     230:</span> 
<a name="231" /><span class="True">     231:</span> <span class="k">/* True if any part of r1 overlaps r2 */</span>
<a name="232" /><span class="True">     232:</span> <span class="m">static</span> <span class="m">inline</span> <span class="m">bool</span> <span class="b">resource_overlaps</span><span class="f">(</span><span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">r1</span><span class="f">,</span> <span class="m">struct</span> <span class="b">resource</span> <span class="f">*</span><span class="b">r2</span><span class="f">)</span>
<a name="233" /><span class="True">     233:</span> <span class="f">{</span>
<a name="234" /><span class="True">     234:</span>        <span class="m">return</span> <span class="f">(</span><span class="b">r1</span><span class="f">-&gt;</span><span class="b">start</span> <span class="f">&lt;=</span> <span class="b">r2</span><span class="f">-&gt;</span><span class="b">end</span> <span class="f">&amp;&amp;</span> <span class="b">r1</span><span class="f">-&gt;</span><span class="b">end</span> <span class="f">&gt;=</span> <span class="b">r2</span><span class="f">-&gt;</span><span class="b">start</span><span class="f">)</span><span class="f">;</span>
<a name="235" /><span class="True">     235:</span> <span class="f">}</span>
<a name="236" /><span class="True">     236:</span> 
<a name="237" /><span class="True">     237:</span> 
<a name="238" /><span class="True">     238:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* __ASSEMBLY__ */</span>
<a name="239" /><span class="True">     239:</span> <span class="f">#</span><span class="n">endif</span>    <span class="k">/* _LINUX_IOPORT_H */</span>
<a name="240" /><span class="True">     240:</span> </pre>
  </body>
</html>
